package edu.towson.cosc603.coffeemaker;

import static org.junit.Assert.*;
import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class RecipeTest extends TestCase {
	private Recipe r;
	
	@Before
	public void setUp() throws Exception {
		r = new Recipe();
	}

	@After
	public void tearDown() throws Exception {
		System.out.println(r);
	}

	// Negative Chocolate
	@Test
	public void testSetAmtChocolate1() {
		r.setAmtChocolate(-1);
		assertEquals( 0, r.getAmtChocolate() );
	}
	
	// All valid inputs
	@Test
	public void testSetAmtChocolate2() {
		r.setAmtChocolate(10);
		assertEquals( 10, r.getAmtChocolate() );
	}
	
	// 0 Chocolate
	@Test
	public void testSetAmtChocolate3() {
		r.setAmtChocolate(0);
		assertEquals( 0, r.getAmtChocolate() );
	}
	
	// Negative Coffee
	@Test
	public void testSetAmtCoffee1() {
		r.setAmtCoffee(-1);
		assertEquals( 0, r.getAmtCoffee() );
	}
	
	// All valid inputs
	@Test
	public void testSetAmtCoffee2() {
		r.setAmtCoffee(10);
		assertEquals( 10, r.getAmtCoffee() );
	}
	
	// 0 Coffee
	@Test
	public void testSetAmtCoffee3() {
		r.setAmtCoffee(0);
		assertEquals( 0, r.getAmtCoffee() );
	}
	
	// Negative Milk
	@Test
	public void testSetAmtMilk1() {
		r.setAmtMilk(-1);
		assertEquals( 0, r.getAmtMilk() );
	}
	
	// All valid inputs
	@Test
	public void testSetAmtMilk2() {
		r.setAmtMilk(10);
		assertEquals( 10, r.getAmtMilk() );
	}
	
	// 0 Milk
	@Test
	public void testSetAmtMilk3() {
		r.setAmtMilk(0);
		assertEquals( 0, r.getAmtMilk() );
	}
	
	// Negative Sugar
	@Test
	public void testSetAmtSugar1() {
		r.setAmtSugar(-1);
		assertEquals( 0, r.getAmtSugar() );
	}
	
	// All valid inputs
	@Test
	public void testSetAmtSugar2() {
		r.setAmtSugar(10);
		assertEquals( 10, r.getAmtSugar() );
	}
	
	// 0 Sugar
	@Test
	public void testSetAmtSugar3() {
		r.setAmtSugar(0);
		assertEquals( 0, r.getAmtSugar() );
	}
	
	// Negative Price
	@Test
	public void testSetPrice1() {
		r.setPrice(-1);
		assertEquals( 0, r.getPrice() );
	}
	
	// All valid inputs
	@Test
	public void testSetPrice2() {
		r.setPrice(100);
		assertEquals( 100, r.getPrice() );
	}
	
	// All valid inputs
	@Test
	public void testEquals1() {
		Recipe newRecipe = new Recipe();
		
		newRecipe.setName("New Recipe");
		
		assertFalse(r.equals(newRecipe));
	}
}
